<?php if(!empty($objProducts)) : ?>
	<?php foreach ($objProducts as $product) :?>
		<?php $linkList = Yii::app()->createUrl('product/list', array('id' => $product->id));?>
	<div class="portfolio_item">
		<div class="top"></div>
		<div class="in">
			<a>
				<img style="width: 380px; height: 205px;" src="<?php echo Util::getImageExist("card", $product->image)?>" alt="<?php echo $product->short_descript?>"/>

				<span  onclick="showProductSlide('<?php echo $product->id;?>')" class="shadow"></span>
			</a>
		</div>
		<div class="bot"></div>
	</div>
	<div class="portfolio_text">
		<h2>
			<a href="#" ><?php echo $product->name;?></a>
			<?php if ($product->code != ''): ?><span class="code_text">(<?php echo $product->code;?>)</span>  <?php endif;?>
		</h2>
		<div class="product_price">Giá: <?php echo number_format($product->price, 0, " ", " ")?> VNĐ</div>
		<div class="description">
			<?php echo $product->description;?>
		</div>
		<div class="clear"></div>
	</div>
	<div class="clear"></div>
	<!-- end portfolio item -->
	<?php $objSlides = $product->slides; ?>
	<?php if (!empty($objSlides)) : $isFirst = true;?>
		<ul style="display: none;" class="gallery clearfix">
			<?php foreach ($objSlides as $slide) : ?>
				<li><a <?php if($isFirst) : echo "id = '{$product->id}'"; endif;?> href="<?php echo Util::getImageExist("slide", $slide->image)?>" rel="prettyPhoto[gallery<?php echo $product->id?>]" title="<?php echo $slide->description;?>"><img src="<?php echo Util::getImageExist("slide", $slide->image)?>" width="60" height="60" alt="<?php echo $slide->title;?>" /></a></li>
			<?php $isFirst = false;endforeach;?>
		</ul>
	<?php endif;?>
	<?php endforeach;?>
<?php else :?>
	<span class="title">Chưa có sản phẩm.<a href="javascript:history.go(-1);">>> Back</a></span>
<?php endif;?>
<script type="text/javascript" charset="utf-8">
	function showProductSlide(product_id) {
		$('#'+product_id).click();
	}
	$(document).ready(function(){
		$("area[rel^='prettyPhoto']").prettyPhoto();
		$(".gallery a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',slideshow:2000, hideflash: true});
	});
</script>